package bean;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="Dia")
public class Dia {
	
	@Id
	private String codDia;
	
	@OneToMany(mappedBy = "dia")
	private List<Aula> aulas;

	public String getCodDia() {
		return codDia;
	}

	public void setCodDia(String codDia) {
		this.codDia = codDia;
	}
	
	public List<Aula> getAulas() {
		return aulas;
	}

	public void setAulas(List<Aula> aulas) {
		this.aulas = aulas;
	}

	@Override
	public boolean equals(Object obj) {
		if(obj instanceof Dia){
			Dia p = (Dia) obj;
			if(p.getCodDia() == this.getCodDia()){
				return true;
			}
		}
		return false;
	}

}
